# coding:UTF-8
# ________________________
# Project_Name:pythonProject
# File_Name:Administrator
# Author:Administrator
# Date_Time:2022/4/22 14:47
# Description:
# ________________________
from selenium import webdriver
import time
from selenium.webdriver.common.by import By



def  foo1():
    """"
    单选框radiodbox和复选框checkbox的选择直接点击，注意一下点击范围
    """
    driver = webdriver.Chrome()
    driver.maximize_window()

    driver.get(r"C:\PycharmProjects\pythonProject\pyzidonghua\selenium_3\example.html")
    is_selected = driver.find_element(By.ID,"web").is_selected()  #判断元素是否被选中
    print(is_selected)

    driver.find_element(By.ID,"web").click()   #勾选复选框

    is_selected = driver.find_element(By.ID,"web").is_selected()  #判断元素是否被选中
    print(is_selected)

    time.sleep(200)






    driver.quit()

if  __name__=="__main__":
    foo1()